package com.xu.system.enums;

import lombok.Getter;

/**
 * 工作日类型
 *
 * @Author: 许乾伟
 * @Date: 2024/12/24 13:31
 */
public enum WorkDateTypeEnum {
    HOLIDAY(1,"节假日"),

    WORKDAY(2,"工作日"),
            ;

    @Getter
    private Integer code;
    @Getter
    private String desc;

    WorkDateTypeEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    /**
     * 通过code获取desc
     * @param code
     * @return
     */
    public static String getDescByCode(Integer code) {
        for (WorkDateTypeEnum type : values()) {
            if (type.getCode().equals(code)) {
                return type.desc;
            }
        }
        return "";
    }
}
